You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 's-garden-hotel' or seo_url = ''s-garden-hotel' LIMIT 1' at line 1 SELECT * FROM visitor_info WHERE visitor_info_id = ''s-garden-hotel' or seo_url = ''s-garden-hotel' LIMIT 1